const Count = require('../models/count_model')
const jsonResult = require('../utils/JSON')

// 统计-获取科室医生统计
exports.countDepartDoc = async (ctx,next) => {
    try {
        let { body } = ctx.request.body;
        console.log(body);
        let res = await Count.countDepartDoc(body);
        console.log(res,"caseListGet");
        ctx.body = jsonResult.resultSuccessJson(undefined, undefined,res)
    } catch (error) {
        console.log(error)
        ctx.body = jsonResult.resultErrorJson(undefined, undefined);
    }
}


// 统计-获取医生患者统计
exports.countDocPatient = async (ctx,next) => {
    try {
        let res = await Count.countDocPatient();
        console.log(res,"countDocPatient");
        ctx.body = jsonResult.resultSuccessJson(undefined, undefined,res)
    } catch (error) {
        console.log(error)
        ctx.body = jsonResult.resultErrorJson(undefined, undefined);
    }
}

// 近七日就诊情况
exports.countState = async (ctx,next) => {
    try {
        let { body } = ctx.request.body;
        let res = await Count.countState(body);
        console.log(res,"countState");
        ctx.body = jsonResult.resultSuccessJson(undefined, undefined,res)
    } catch (error) {
        console.log(error)
        ctx.body = jsonResult.resultErrorJson(undefined, undefined);
    }
}